package com.cyou.qb.common.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cyou.qb.common.dao.CodeDao;
import com.cyou.qb.common.domain.Code;
import com.cyou.qb.common.service.CodeService;

@Service
public class CodeServiceImpl extends BaseSerivceImpl implements CodeService {

	@Autowired
	private CodeDao codeDao;

	public int deleteDataByType(String type) {
		int count = codeDao.deleteDataByType(type);
		this.getServiceContext().addLog(null, -1, "t_code", "批量删除字典表", null, null);
		return count;
	}

	@Override
	public int insertIntoCode(List<Code> codeList) {
		int count = codeDao.insert(codeList);
		this.getServiceContext().addLog(null, -1, "t_code", "批量插入字典表", new Object[] { codeList }, null);
		return count;
	}

	public CodeDao getCodeDao() {
		return codeDao;
	}

	public void setCodeDao(CodeDao codeDao) {
		this.codeDao = codeDao;
	}

}
